import request from "@/utils/request";

// 获取商品详情
export const getGoodsDetail = (id) => {
  return request('/goods', 'get', { id })
}

// 获取相关推荐商品|猜你喜欢商品
export const getRelevantGoods = ({ id, limit = 16 }) => {
  return request('/goods/relevant', 'get', { id, limit })
}
/**
 * 获取热榜商品信息
 * @param {String} id - 商品id
 * @param {Integer} limit - 商品数量
 * @param {Integer} type - 热销榜类型，1为24小时热榜，2为周榜，3为总榜
 */
export const getGoodsHot = ({ id, limit = 3, type = 1 }) => {
  return request('/goods/hot', 'get', { id, limit, type })
}
// 获取商品评论数据
export const getGoodsCommentInfo = (id) => {
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate`, 'get')
  // return request(`/goods/${id}/evaluate`, 'get')
}
// 获取商品评论列表
export const getGoodsCommentList = (id, params) => {
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page`, 'get', { params })
  // return request(`/goods/${id}/evaluate/page`, 'get', { params })
}
/**
 * 获取商品的specs和skus
 * @param {String} skuId - 商品SKUID
 * @returns Promise
 */
export const getSpecsAndSkus = (skuId) => {
  return request(`/goods/sku/${skuId}`, 'get')
}
